<?php
JunctionFileCabinet::using("Junction_Mapping_Table");

class Test_Junction_Mapping_Table extends UnitTestCase {
	
	/**
	 * @var Junction_Mapping_Table
	 */
	private $_table;
	
	public function testConstruct() {
		$this->_table = new Junction_Mapping_Table("users");
		$this->pass();
	}
	
	public function testColumns() {
		$this->_table->addColumn("id", "user_id");
		$this->_table->addColumn("name", "username");
		$this->pass();
		$this->assertTrue($this->_table->propertyToColumn("id") == "user_id");
		$this->assertTrue($this->_table->contains("name"));
		$i = 0;
		foreach ($this->_table->getColumns() as $property => $column) {
			$i++;
		}
		$this->assertTrue($i == 2);
	}
}
?>